<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>

 <%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
<link rel="stylesheet" href="<%=basePath %>/css/list.css">
<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
<script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
<script src="<%=basePath %>/js/jquery.min.js"></script>
<script src="<%=basePath %>/js/formsJS.js"></script>

<script type="text/javascript">

function checkForm(f){
	
		 	if(f.menuName.value.replace(/\s/g,'') == ''){
				alert("菜单名称不能为空");
				return false;
			}
			
			if(f.menuLevel.value.replace(/\s/g,'') == ''){
				alert("菜单级别不能为空");
				return false;
			}
			if(f.hasChild.value.replace(/\s/g,'') == ''){
				alert("是否有子节点不能为空");
				return false;
			}
			if(f.menuStatus.value.replace(/\s/g,'') == ''){
				alert("菜单状态不能为空");
				return false;
			}
			if(f.orderNum.value.replace(/\s/g,'') == ''){
				alert("菜单排序不能为空");
				return false;
			}
			
 
	return true;
}

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">系统菜单信息维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/sysMenu/sysMenuEdit" method="post" onsubmit="return checkForm(this)" name="dataForm"
					enctype="multipart/form-data">
					<div class="col-sm-4"></div>
	    				<div class="col-sm-4">
	    						<div class="boxs">
									<input type="hidden" name="menuId" value="${sysMenu.menuId}">
									<input type="text" class="inputBox" placeholder="菜单名称" name=menuName value="${sysMenu.menuName}" >
 									<select id="menuLevel" name="menuLevel" class="selectBox"  >
									  	<option value="">菜单级别</option>
							  			<option value="1" ${sysMenu.menuLevel == 1 ? 'selected="selected"' : '' }>一级</option>
							  			<option value="2" ${sysMenu.menuLevel == 2 ? 'selected="selected"' : '' }>二级</option>
									</select>
									<select id="hasChild" name="hasChild" class="selectBox"  >
									  	<option value="">是否有子节点</option>
							  			<option value="1" ${sysMenu.hasChild == 1 ? 'selected="selected"' : '' }>是</option>
							  			<option value="2" ${sysMenu.hasChild == 2 ? 'selected="selected"' : '' }>否</option>
									</select>
									
									<select class="selectBox" name="parentMenuId" id="parentMenuId">
					    				<option value="">----父级菜单----</option>
						    			<c:forEach items="${menus}" var="menu">
						    				<option value="${menu.menuId}" ${menu.menuId == sysMenu.parentMenuId ? 'selected="selected"' : ''}>${menu.menuId}:${menu.menuName}</option>
						    			</c:forEach>
					    			</select>
									
									<input type="text" class="inputBox" placeholder="菜单路径" name="menuUrl" value="${sysMenu.menuUrl}" >
									
									<select id="menuStatus" name="menuStatus" class="selectBox"  >
									  	<option value="">菜单状态</option>
							  			<option value="1" ${sysMenu.menuStatus == 1 ? 'selected="selected"' : '' }>显示</option>
							  			<option value="2" ${sysMenu.menuStatus == 2 ? 'selected="selected"' : '' }>不显示</option>
									</select>
									
									<input type="number" class="inputBox" placeholder="一级排序" name="orderId" value="${sysMenu.orderId}" >
									<input type="number" class="inputBox" placeholder="二级排序" name="orderNum" value="${sysMenu.orderNum}" >
									
 									<textarea  id="remark" name="remark" class="textareaBox" placeholder="备注说明">${sysMenu.remark}</textarea>
									<br><br>
							 
									<input type="submit" value="确定" class="true"   />
									<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
								</div>
						 </div>
					</form>
			</div>
	</div>
	
</body>
	 
</html>